import { Toast } from 'mint-ui';

export default {

  "commonToast": function (msg, pos = "bottom", time = 2000) {
    Toast({
      message: msg,
      position: pos,
      duration: time
    });
  },

  "errorToast": function (msg = "请求失败，请稍后重试", pos = "bottom", time = 2000) {
    Toast({
      message: msg,
      position: pos,
      duration: time
    });
  },

  "toastAndLogin": function (msg, pos = "bottom", time = 2000) {
    Toast({
      message: msg,
      position: pos,
      duration: time
    });
    this.$router.push("/login");
  }
}
